
import type { FormRules } from 'element-plus'
import { reactive } from 'vue'
export const form = reactive({
  businesstype: '',
  companycode: '',
  sitecode: '',
  stationname: '',
  stationcode: '',
  userproperty: '',
  usertype: '',
  stationtype: '',
  powersupply: '',
  powerlevel: '',
  mainnumber: '',
  installedcapacity: '',
  runcapacity: '',
  address: '',
  electricity_price: '',
  Contact: '',
  tel: ''
})

export const rules = reactive<FormRules>({
  businesstype: [{ required: true, message: '请选择业务类型' }],
  companycode: [{ required: true, message: '请选择企业' }],
  sitecode: [{ required: true, message: '请选择站点' }],
  stationname: [{ required: true, message: '请输入电站名称' }],
  stationcode: [{ required: true, message: '请输入电站编号' }],
  userproperty: [{ required: true, message: '请选择用户性质' }],
  usertype: [{ required: true, message: '请选择用户类别' }],
  stationtype: [{ required: true, message: '请选择站点类型' }],
  powersupply: [{ required: true, message: '请输入供电单位' }],
  powerlevel: [{ required: true, message: '请选择电压等级' }],
  mainnumber: [{ required: true, message: '请输入主变总数' }],
  installedcapacity: [{ required: true, message: '请输入装机容量' }],
  runcapacity: [{ required: true, message: '请输入运行容量' }],
  address: [{ required: true, message: '请输入用电地址' }],
  electricity_price: [{ required: true, message: '请输入用电单价' }],
  Contact: [{ required: true, message: '请输入管理部门' }],
  tel: [{ required: true, message: '请输入配电管理部门电话' }],
})
export const saveAdd = (callback?: Function) => {
  typeof callback === 'function' && callback()
}
export const queryEdit = (id: string) => {
  console.log('id:==', id)
} 
export const saveEdit = (callback?: Function) => {
  typeof callback === 'function' && callback()
}
export const saveDel = (id: string, callback?: Function) => {
  console.log('id--:', id)
  typeof callback === 'function' && callback()
}
